package org.nowcoder.huawei.c100;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class HC014 {
    static class Point {
        int x;
        int y;

        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }

        @Override
        public String toString() {
            return x + " " + y + " ";
        }
    }

    public static void main(String[] args) {
        try {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            String[] vars = br.readLine().split(" ");
            List<Point> points = new ArrayList<>();
            for (int i = 0; i < vars.length - 1; i += 2) {
                int x = Integer.parseInt(vars[i]);
                int y = Integer.parseInt(vars[i + 1]);
                points.add(new Point(x, y));
            }
            solve(points);
        } catch (Exception ignore) {

        }
    }


    public static void solve(List<Point> points) {
        List<Point> results = new ArrayList<>();
        if (points.size() <= 2) {
            results.addAll(points);
            return;
        }
        results.add(points.get(0));
        for (int i = 1; i < points.size() - 1; i++) {
            Point pre = points.get(i - 1);
            Point cur = points.get(i);
            Point next = points.get(i + 1);
            if (!isTurningPoint(pre, cur, next)) {
                results.add(cur);
            }
        }
        results.add(points.get(points.size() - 1));
        results.forEach(System.out::print);
    }

    public static boolean isTurningPoint(Point pre, Point cur, Point next) {
        int x1 = cur.x - pre.x;
        int y1 = cur.y - pre.y;
        int x2 = next.x - pre.x;
        int y2 = next.y - pre.y;
        return x1 * y2 == x2 * y1;
    }
}
